package cn.dw.web.interceptor.PrivilegeInterceptor;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;

public class PrivilegeInterceptor extends MethodFilterInterceptor {
	private static final long serialVersionUID = -6150848814997140960L;

	protected String doIntercept(ActionInvocation invocation) throws Exception {
		Object object = ActionContext.getContext().getSession().get("user");
		if (object != null) {
			return invocation.invoke();
		}
		return "toLogin";
	}
}
